package com.yf.springboot.actuator.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;

/**
 * 为了写这个中文注释折腾了一宿
 * https://blog.csdn.net/qq_41859728/article/details/109187748
 * https://github.com/RikudouPatrickstar/JetBrainsRuntime-for-Linux-x64/releases
 */
@Component
@Endpoint(id = "myEndPoint")
public class MyEndPoint {
    @ReadOperation
    public Map getInfo() {
        return Collections.singletonMap("info", "this is myEndPoint");
    }

    @WriteOperation
    public void setInfo() {
        System.out.println("myEndPoint::setInfo");
    }
}